rm(list=ls())
library(foreign)

response <- c("Allow none","Allow a few","Allow some","Allow many")
area <- c("African migrants", "Arab migrants")
values <- matrix(c(17.39,7.93,45.22,42.69,29.71,36.12,7.68,13.26), nrow = 4, ncol = 2, byrow = TRUE)
color <- c("gray40","gray60","gray80","gray90")

pdf("allow.pdf")

barplot(values, xlim=c(0, ncol(values) + 1.7), main = "Figure 1: Divergent Bias Against Sub-Saharan African and Arab Migrants and Refugees", names.arg = area, xlab = "Migrants", ylab = "Attitudes(%)", col = color, cex.main=.9)
legend("topright", c("Allow many","Allow some","Allow a few","Allow none"), cex = 1, fill = c("gray90","gray80","gray60","gray40"))
legend(0.3,99.5,"N=204", bty="n")
legend(0.3,75,"N=789", bty="n")
legend(0.3,35,"N=1201", bty="n")
legend(0.3,8,"N=462", bty="n")

legend(1.5,99.5,"N=351", bty="n")
legend(1.5,75,"N=956", bty="n")
legend(1.5,35,"N=1130", bty="n")
legend(1.5,8,"N=210", bty="n")

dev.off()






